
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>第 2 章 快速入门 · 大数据 Fulume 课堂笔记</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content=" 李振超">
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-page-toc-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-prism/prism-base16-ateliersulphurpool.light.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-change_girls/girls.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="styles/website.css">
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="di-3-zhang-qi-ye-kai-fa-an-li.html" />
    
    
    <link rel="prev" href="14-flume-nei-bu-yuan-li.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="http://www.atguigu.com/" target="_blank" class="custom-link">联系我们</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    第 1 章 概述
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.1" data-path="11-flume-de-zuo-yong.html">
            
                <a href="11-flume-de-zuo-yong.html">
            
                    
                    1.1 Flume 是什么
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.2" data-path="12-flume-zu-cheng-jia-gou.html">
            
                <a href="12-flume-zu-cheng-jia-gou.html">
            
                    
                    1.2 Flume 组成架构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3" data-path="13-flume-tuo-pu-jia-gou.html">
            
                <a href="13-flume-tuo-pu-jia-gou.html">
            
                    
                    1.3 Flume 拓扑架构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.4" data-path="14-flume-nei-bu-yuan-li.html">
            
                <a href="14-flume-nei-bu-yuan-li.html">
            
                    
                    1.4 Flume 内部原理
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter active" data-level="1.2" data-path="chapter1.html">
            
                <a href="chapter1.html">
            
                    
                    第 2 章 快速入门
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="di-3-zhang-qi-ye-kai-fa-an-li.html">
            
                <a href="di-3-zhang-qi-ye-kai-fa-an-li.html">
            
                    
                    第 3 章 企业开发案例
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="di-3-zhang-qi-ye-kai-fa-an-li/31-guan-fang-an-4f8b3a-jian-kong-duan-kou-shu-ju.html">
            
                <a href="di-3-zhang-qi-ye-kai-fa-an-li/31-guan-fang-an-4f8b3a-jian-kong-duan-kou-shu-ju.html">
            
                    
                    3.1 官方案例:监控端口数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="di-3-zhang-qi-ye-kai-fa-an-li/32-shi-shi-du-qu-ben-di-wen-jian-dao-hdfs-an-li.html">
            
                <a href="di-3-zhang-qi-ye-kai-fa-an-li/32-shi-shi-du-qu-ben-di-wen-jian-dao-hdfs-an-li.html">
            
                    
                    3.2 实时读取本地文件到HDFS案例
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="di-3-zhang-qi-ye-kai-fa-an-li/33-shi-shi-du-qu-mu-lu-wen-jian-dao-hdfs.html">
            
                <a href="di-3-zhang-qi-ye-kai-fa-an-li/33-shi-shi-du-qu-mu-lu-wen-jian-dao-hdfs.html">
            
                    
                    3.3 实时读取目录文件到 HDFS
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="di-3-zhang-qi-ye-kai-fa-an-li/34-dan-shu-ju-yuan-duo-chu-kou-an-li.html">
            
                <a href="di-3-zhang-qi-ye-kai-fa-an-li/34-dan-shu-ju-yuan-duo-chu-kou-an-li.html">
            
                    
                    3.4 单数据源多出口案例(选择器)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="di-3-zhang-qi-ye-kai-fa-an-li/35-dan-shu-ju-yuan-duo-chu-kou-an-4f8b28-sink-7ec429.html">
            
                <a href="di-3-zhang-qi-ye-kai-fa-an-li/35-dan-shu-ju-yuan-duo-chu-kou-an-4f8b28-sink-7ec429.html">
            
                    
                    3.5 单数据源多出口案例(Sink组)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="di-3-zhang-qi-ye-kai-fa-an-li/36-duo-shu-ju-yuan-hui-zong-an-li.html">
            
                <a href="di-3-zhang-qi-ye-kai-fa-an-li/36-duo-shu-ju-yuan-hui-zong-an-li.html">
            
                    
                    3.6 多数据源汇总案例
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="di-4-zhang-flume-jian-kong-zhi-ganglia.html">
            
                <a href="di-4-zhang-flume-jian-kong-zhi-ganglia.html">
            
                    
                    第 4 章 Flume 监控之 Ganglia
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="di-4-zhang-flume-jian-kong-zhi-ganglia/41-ganglia-de-an-zhuang-he-bu-shu.html">
            
                <a href="di-4-zhang-flume-jian-kong-zhi-ganglia/41-ganglia-de-an-zhuang-he-bu-shu.html">
            
                    
                    4.1 Ganglia 的安装和部署
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="di-4-zhang-flume-jian-kong-zhi-ganglia/42-cao-zuo-flume-ce-shi-jian-kong.html">
            
                <a href="di-4-zhang-flume-jian-kong-zhi-ganglia/42-cao-zuo-flume-ce-shi-jian-kong.html">
            
                    
                    4.2 操作 Flume 测试监控
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="di-5-zhang-zi-ding-yi-source.html">
            
                <a href="di-5-zhang-zi-ding-yi-source.html">
            
                    
                    第 5 章 自定义 source
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="di-5-zhang-zi-ding-yi-source/51-xu-qiu.html">
            
                <a href="di-5-zhang-zi-ding-yi-source/51-xu-qiu.html">
            
                    
                    5.1 需求
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="di-5-zhang-zi-ding-yi-source/52-fen-xi.html">
            
                <a href="di-5-zhang-zi-ding-yi-source/52-fen-xi.html">
            
                    
                    5.2 分析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="di-5-zhang-zi-ding-yi-source/53-bian-ma.html">
            
                <a href="di-5-zhang-zi-ding-yi-source/53-bian-ma.html">
            
                    
                    5.3 编码
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="di-5-zhang-zi-ding-yi-source/54-ce-shi.html">
            
                <a href="di-5-zhang-zi-ding-yi-source/54-ce-shi.html">
            
                    
                    5.4 测试
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="di-5-zhang-qi-ye-zhen-shi-mian-shi-ti.html">
            
                <a href="di-5-zhang-qi-ye-zhen-shi-mian-shi-ti.html">
            
                    
                    第 6 章 企业真实面试题
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >第 2 章 快速入门</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x7B2C;-2-&#x7AE0;-&#x5FEB;&#x901F;&#x5165;&#x95E8;">&#x7B2C; 2 &#x7AE0; &#x5FEB;&#x901F;&#x5165;&#x95E8;</h1>
<h2 id="21-&#x4E0B;&#x8F7D;">2.1 &#x4E0B;&#x8F7D;</h2>
<p>1&#xFF09; Flume&#x5B98;&#x7F51;&#x5730;&#x5740;</p>
<p><a href="http://flume.apache.org/" target="_blank">http://flume.apache.org/</a></p>
<p>2&#xFF09;&#x6587;&#x6863;&#x67E5;&#x770B;&#x5730;&#x5740;</p>
<p><a href="http://flume.apache.org/FlumeUserGuide.html" target="_blank">http://flume.apache.org/FlumeUserGuide.html</a></p>
<p>3&#xFF09;&#x4E0B;&#x8F7D;&#x5730;&#x5740;</p>
<p><a href="http://archive.apache.org/dist/flume/" target="_blank">http://archive.apache.org/dist/flume/</a></p>
<h2 id="22-&#x5B89;&#x88C5;&#x90E8;&#x7F72;">2.2 &#x5B89;&#x88C5;&#x90E8;&#x7F72;</h2>
<h2 id="&#x6B65;&#x9AA4;1-&#x628A;-apache-flume-170-bintargz-&#x4E0A;&#x4F20;&#x5230;-linux&#x7684;optsoftware-&#x76EE;&#x5F55;&#x4E0B;">&#x6B65;&#x9AA4;1: &#x628A; apache-flume-1.7.0-bin.tar.gz &#x4E0A;&#x4F20;&#x5230; linux&#x7684;/opt/software &#x76EE;&#x5F55;&#x4E0B;</h2>
<h2 id="&#x6B65;&#x9AA4;2-&#x89E3;&#x538B;-apache-flume-170-bintargz-&#x5230;-optmodule-&#x76EE;&#x5F55;&#x4E0B;">&#x6B65;&#x9AA4;2: &#x89E3;&#x538B; apache-flume-1.7.0-bin.tar.gz &#x5230; /opt/module/ &#x76EE;&#x5F55;&#x4E0B;</h2>
<pre class="language-"><code class="lang-bash"><span class="token function">tar</span> -zxvf apache-flume-1.7.0-bin.tar.gz -C /opt/module/
</code></pre>
<h2 id="&#x6B65;&#x9AA4;3-&#x4FEE;&#x6539;&#x76EE;&#x5F55;-apache-flume-170-bin-&#x7684;&#x540D;&#x79F0;&#x4E3A;-flume">&#x6B65;&#x9AA4;3: &#x4FEE;&#x6539;&#x76EE;&#x5F55; apache-flume-1.7.0-bin &#x7684;&#x540D;&#x79F0;&#x4E3A; flume</h2>
<pre class="language-"><code class="lang-bash"><span class="token function">cp</span> -r apache-flume-1.7.0-bin flume
</code></pre>
<h2 id="&#x6B65;&#x9AA4;4-&#x914D;&#x7F6E;-flume-envsh">&#x6B65;&#x9AA4;4: &#x914D;&#x7F6E; flume-env.sh</h2>
<p>&#x5C06; flume/conf &#x4E0B;&#x7684; flume-env.sh.template &#x6587;&#x4EF6;&#x4FEE;&#x6539;&#x4E3A; flume-env.sh&#xFF0C;&#x5E76;&#x914D;&#x7F6E;flume-env.sh &#x6587;&#x4EF6;.</p>
<pre class="language-"><code class="lang-bash"><span class="token function">cp</span> flume-env.sh.template flume-env.sh
</code></pre>
<p>&#x5728;&#x6587;&#x4EF6;&#x5185;&#x914D;&#x7F6E;<code>JAVA_HOME</code></p>
<pre class="language-"><code class="lang-bash"><span class="token function">export</span> JAVA_HOME<span class="token operator">=</span>/opt/module/jdk1.8.0_172
</code></pre>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; &#x5C1A;&#x7845;&#x8C37;&#x5927;&#x6570;&#x636E; 2019 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification"><br>&#x8BE5;&#x6587;&#x4EF6;&#x6700;&#x540E;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2018-11-20 18:14:16
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="14-flume-nei-bu-yuan-li.html" class="navigation navigation-prev " aria-label="Previous page: 1.4 Flume 内部原理">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="di-3-zhang-qi-ye-kai-fa-an-li.html" class="navigation navigation-next " aria-label="Next page: 第 3 章 企业开发案例">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"第 2 章 快速入门","level":"1.2","depth":1,"next":{"title":"第 3 章 企业开发案例","level":"1.3","depth":1,"path":"di-3-zhang-qi-ye-kai-fa-an-li.md","ref":"di-3-zhang-qi-ye-kai-fa-an-li.md","articles":[{"title":"3.1 官方案例:监控端口数据","level":"1.3.1","depth":2,"path":"di-3-zhang-qi-ye-kai-fa-an-li/31-guan-fang-an-4f8b3a-jian-kong-duan-kou-shu-ju.md","ref":"di-3-zhang-qi-ye-kai-fa-an-li/31-guan-fang-an-4f8b3a-jian-kong-duan-kou-shu-ju.md","articles":[]},{"title":"3.2 实时读取本地文件到HDFS案例","level":"1.3.2","depth":2,"path":"di-3-zhang-qi-ye-kai-fa-an-li/32-shi-shi-du-qu-ben-di-wen-jian-dao-hdfs-an-li.md","ref":"di-3-zhang-qi-ye-kai-fa-an-li/32-shi-shi-du-qu-ben-di-wen-jian-dao-hdfs-an-li.md","articles":[]},{"title":"3.3 实时读取目录文件到 HDFS","level":"1.3.3","depth":2,"path":"di-3-zhang-qi-ye-kai-fa-an-li/33-shi-shi-du-qu-mu-lu-wen-jian-dao-hdfs.md","ref":"di-3-zhang-qi-ye-kai-fa-an-li/33-shi-shi-du-qu-mu-lu-wen-jian-dao-hdfs.md","articles":[]},{"title":"3.4 单数据源多出口案例(选择器)","level":"1.3.4","depth":2,"path":"di-3-zhang-qi-ye-kai-fa-an-li/34-dan-shu-ju-yuan-duo-chu-kou-an-li.md","ref":"di-3-zhang-qi-ye-kai-fa-an-li/34-dan-shu-ju-yuan-duo-chu-kou-an-li.md","articles":[]},{"title":"3.5 单数据源多出口案例(Sink组)","level":"1.3.5","depth":2,"path":"di-3-zhang-qi-ye-kai-fa-an-li/35-dan-shu-ju-yuan-duo-chu-kou-an-4f8b28-sink-7ec429.md","ref":"di-3-zhang-qi-ye-kai-fa-an-li/35-dan-shu-ju-yuan-duo-chu-kou-an-4f8b28-sink-7ec429.md","articles":[]},{"title":"3.6 多数据源汇总案例","level":"1.3.6","depth":2,"path":"di-3-zhang-qi-ye-kai-fa-an-li/36-duo-shu-ju-yuan-hui-zong-an-li.md","ref":"di-3-zhang-qi-ye-kai-fa-an-li/36-duo-shu-ju-yuan-hui-zong-an-li.md","articles":[]}]},"previous":{"title":"1.4 Flume 内部原理","level":"1.1.4","depth":2,"path":"14-flume-nei-bu-yuan-li.md","ref":"14-flume-nei-bu-yuan-li.md","articles":[]},"dir":"ltr"},"config":{"plugins":["splitter","expandable-chapters-small","page-toc-button","-highlight","prism","prism-themes","tbfed-pagefooter","sitemap","change_girls","livereload"],"styles":{"website":"styles/website.css","ebook":"styles/ebook.css","pdf":"styles/pdf.css","mobi":"styles/mobi.css","epub":"styles/epub.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy 尚硅谷大数据 2019","modify_label":"<br>该文件最后修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"prism":{"css":["prism-themes/themes/prism-base16-ateliersulphurpool.light.css"]},"disqus":{"shortName":"zhenchao125"},"livereload":{},"splitter":{},"change_girls":{"time":30,"urls":["http://o7cqr8cfk.bkt.clouddn.com/18-3-4/62171757.jpg-atguiguImg","http://o7cqr8cfk.bkt.clouddn.com/18-3-4/83394736.jpg-atguiguImg","http://o7cqr8cfk.bkt.clouddn.com/18-3-4/15906185.jpg-atguiguImg","http://o7cqr8cfk.bkt.clouddn.com/18-3-4/15906185.jpg-atguiguImg","http://o7cqr8cfk.bkt.clouddn.com/18-3-4/3394270.jpg-atguiguImg","http://o7cqr8cfk.bkt.clouddn.com/18-3-4/65028582.jpg-atguiguImg","http://o7cqr8cfk.bkt.clouddn.com/18-3-4/20359261.jpg-atguiguImg","http://o7cqr8cfk.bkt.clouddn.com/18-3-4/37472401.jpg-atguiguImg","http://o7cqr8cfk.bkt.clouddn.com/18-3-4/3355397.jpg-atguiguImg","http://o7cqr8cfk.bkt.clouddn.com/18-3-4/11075549.jpg-atguiguImg"]},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"sitemap":{"hostname":"https://www.gitbook.com/@zhenchao125"},"page-toc-button":{"maxTocDepth":3,"minTocSize":2},"prism-themes":{},"expandable-chapters-small":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":" 李振超","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"大数据 Fulume 课堂笔记","language":"zh-hans","links":{"sidebar":{"联系我们":"http://www.atguigu.com/"}},"gitbook":"*","description":"课堂笔记,学生提前预习"},"file":{"path":"chapter1.md","mtime":"2018-11-20T10:14:16.008Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-01-25T01:39:38.954Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-page-toc-button/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-change_girls/girls.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

